package stringStatistical;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String str;
        int cnt = 0;

        System.out.print("请输入一句话，来检查有多少个”把字“：");
        str = input.next();
        String[] strs = str.split("");//我一把把把把住了
        for (int i=0; i<strs.length; ++i) {
            if ("把".equals(strs[i]) )
                cnt++;
        }
        System.out.println("有"+ cnt + "个”把“字");
    }
}
